#ifndef SITEPARSER_H
#define SITEPARSER_H

#include <QObject>
#include <QString>
#include <QUrl>

class SiteParser:public QObject{
    Q_OBJECT
protected:

    static const int GET_FORM=1; //push free user button
    static const int GET_CAPTCHA=2;
    static const int GET_FILE=3;
    static const int FILE_DELETED=4;
    static const int SHORT_DELAY=5;
    static const int LONG_DELAY=6;
    static const int IN_USE=7;

    QString *buf;
    QString *path;
    QString *post;
    QString lPath;
    SiteParser();
public:
    static SiteParser* getInstance(QString);
    ~SiteParser();
    virtual void parsePage(QString)=0;
    virtual void getForm(QString)=0;
    virtual QString type()=0;
    int getShortDelay();
    QString* getPath(){
        return path;
    }
    QString* getPost(){
        return post;
    }
    void testPage();
    void append(QString);
    void setLinkAddr(QString path){
        lPath=path;
    }

signals:
    void wait(int);
    void goForm(QUrl path, QString post);
    void error(int errCode);
    void info(int errCode);



};

#endif // SITEPARSER_H
